body {
    background-color: #FFEFD5;
}

/*最外层div包裹整个动画*/

#top {
    width: 180px;
    height: 180px;
    margin: 200px auto 0 auto;
    perspective: 450px;
}

/*创建的动画*/

@keyframes myfirst {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    35% {
        transform: rotateX(360deg) rotateY(0deg) rotateZ(0deg);
    }
    70% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(0deg);
    }
    100% {
        transform: rotateX(0deg) rotateY(0deg) rotatez(0deg);
    }
}

/*box代表整个魔方*/

.box {
    transform-style: preserve-3d;
    transform-origin: 90px 90px 0;
    animation: myfirst 5s ease infinite;
}

.said1,
.said2,
.said3,
.said4,
.said5,
.said6 {
    width: 180px;
    height: 180px;
    border: 4px solid #7CFC00;
    position: absolute;
}

/*第一个边*/

.said1 {
    transform: translateZ(90px);
}

/*第二个边*/

.said2 {
    transform: rotateX(-90deg) translateZ(90px);
}

/*第三个边*/

.said3 {
    transform: rotateX(90deg) translateZ(90px);
}

/*第四个边*/

.said4 {
    transform: rotateY(-90deg) translateZ(90px);
}

/*第五个边*/

.said5 {
    transform: rotateY(90deg) translateZ(90px);
}

/*第六个边*/

.said6 {
    transform: translateZ(-90px);
}

/*saida 代表每个边的每个小方框*/

.saida {
    position: relative;
    width: 60px;
    height: 60px;
    box-sizing: border-box;
    border: 1px solid white;
    float: left;
}

/*下边9个class代表每个边的9个小方框*/

.white {
    background-color: white;
}

.green {
    background-color: #C6E2FF;
}

.blue {
    background-color: #AB82FF;
}

.yellow {
    background-color: yellow;
}

.orange {
    background-color: #FFB90F;
}

.red {
    background-color: #FF4040;
}

.purple {
    background-color: #D15FEE;
}

.black {
    background-color: black;
}

.pink {
    background-color: pink;
}
